]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: Fix some issues with the label API
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 22 Aug 2012 10:05:21 +0000 (07:05 -0300)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 22 Aug 2012 18:55:24 +0000 (15:55 -0300)
Be able to call setLabelText more than once.

https://bugzilla.gnome.org/show_bug.cgi?id=682445

js/ui/dash.js

index bc98ae323517746eb81d9c8a996fce7fa04c0acb..47f6f4d3950af8e31a42063878192c37e8a6897f 100644 (file)
@@ -124,15 +124,19 @@ const DashItemContainer = new Lang.Class({
     },
 
     setLabelText: function(text) {
-        if (this.label == null)
+        if (this.label == null) {
             this.label = new St.Label({ style_class: 'dash-label'});
+            Main.layoutManager.addChrome(this.label);
+            this.label.hide();
+        }
 
         this.label.set_text(text);
-        Main.layoutManager.addChrome(this.label);
-        this.label.hide();
     },
 
     hideLabel: function () {
+        if (this.label == null)
+            return;
+
         Tweener.addTween(this.label,
                          { opacity: 0,
                            time: DASH_ITEM_LABEL_HIDE_TIME,